package com.cloud.basic.feign.say;

import com.cloud.basic.spring.SpringContextUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/client")
public class TestClientController {

    public static void main(String[] args) {
        TestService_Service testServiceService = new TestService_Service();
        TestService service = testServiceService.getTestServiceImplPort();
        String msg = "<user><id>10012334223</id><name>蒲公英不是梦</name><sex>2</sex></user>";
        service.execute("同步用户信息",msg);

//        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
//
//        //在获取连接之前 还原上下文
//        Thread.currentThread().setContextClassLoader(classLoader);
//        // 服务地址
//        String url = "http://localhost:8083/webService/testService?wsdl";
//        // 方法名称
//        String methodName = "getData";
//        // 参数1
//        String action = "同步用户信息";
//        // 参数2
//        String msg = "<user><id>10012334223</id><name>蒲公英不是梦</name><sex>1</sex></user>";
//        try {
//            // 发起请求
//            System.out.println(WsClientUtil.callWebService(url, methodName, action, msg));
//        } catch (Exception e) {
//            System.out.println(String.format("webService调用异常：%s", e.getMessage()));
//        }


    }

}